import allRoutes from "../router/allRoute"

const digui = (allRoutes,menuList)=>{
    let userRoutes = []
    allRoutes.forEach(item=>{
        menuList.forEach(key=>{
            if(item.meta.name == key.name){
                
                if(key.children && key.children.length > 0){
                    item.children=digui(item.children,key.children)
                }
                userRoutes.push(item)
            }
        })
    })
    return userRoutes
}

let menuList = [
  {  "name":"管理首页"},
  {"name":"学员管理",
    children:[
        {"name":"学员项目管理"}
    ]
  },
  {
    "name":"我的中心"
  }
]
console.log(digui(allRoutes,menuList));